package com.xwj.back.controller;

import com.xwj.back.pojo.Menu;
import com.xwj.back.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class MenuController {

    @Autowired
    private MenuService menuService;

    //获取菜单
    @GetMapping("/menu/")
    public List<Menu> getMenu(@RequestParam Map<String,String> data){
        Integer roleId = Integer.parseInt(data.get("roleId"));
        return menuService.getMenu(roleId);
    }
}
